package net.qhzw.admin.controller;

import net.qhzw.admin.service.SysAreaService;
import net.qhzw.common.model.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("sys/area")
public class SysAreaController {


    @Autowired
    private SysAreaService areaService;


    /***
     * 根据父级code查询地区
     * @param pcode
     * @return
     */
    @GetMapping("getArea")
    public JsonResult getArea(@RequestParam(required = false, defaultValue = "0", value = "pcode") Long pcode) {
        return areaService.getArea(pcode);
    }


}
